Skip to main content
Version: 5.6

Logging Service

This service is used to start and stop the time recording and to administrate the recording settings.

GetActiveTimeEntry

This method returns the current active time entry. If no time recording is active, it returns NULL.

ActiveTimeEntryDto GetActiveTimeEntry(  
out TpFault fault,
TpAuthentication authentication);
Needed Permissionlogging@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
return valueThe active time entry or NULL, if the time tracking has not been started.

SearchActiveTimeEntries

This method searches for active time-entries with the given filter. The permission of the authenticated user will be considered. Only time entries of the user profiles that the user is allowed to access will be returned.

List<ActiveTimeEntryDto> SearchActiveTimeEntries(  
out TpFault fault,
TpAuthentication authentication,
ActiveTimeEntrySearchDto search);
Needed PermissiontimeEntries@access / core@switchIdentity
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
searchThe filter that is used to search the time entries
Return valueCollection with the found time entries

StartWorkTimeLogging

This method starts the work time recording.

ActiveTimeEntryDto StartWorkTimeLogging(  
out TpFault fault,
TpAuthentication authentication,
Guid projectId,
Guid? taskId,
Guid? customerId,
string description,
DateTime? startTime,
out List<TimeEntryDto> todayEntries);
Needed PermissionstartTime == null ? logging@access : logging@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
projectIdThe id of the project that is used to start the time recording
taskIdThe id of the task that is used for the time recording
customerIdThe id of the customer that is used for the time recording
descriptionThe description that will be used for the time recording
startTimeThe start time of the time recording. Regularly this should be NULL; otherwise a higher user-permission is needed.
todayEntriesOutCollection of all entries of the current day.
Return valueThe current time entry that has been started by the method.

StartBreakTimeLogging

This method starts a new break time recording. It’s important that this can only be done if an active time recording is already in place. A break can only be started as a part of the current work time recording.

ActiveTimeEntryDto StartBreakTimeLogging(  
out TpFault fault,
TpAuthentication authentication);
Needed Permissionlogging@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
return valueThe current time entry that has been modified by the method.

EndLogging

This method ends the current recording and commits the recorded time entry for the user.

ActiveTimeEntryDto EndLogging(  
out TpFault fault,
TpAuthentication authentication,
DateTime? endTime,
out TimeSpan? committedWorkTime,
out List<TimeEntryDto> todayEntries);
Needed PermissionendTime == null ? logging@access : logging@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
endTimeThe end time of the time recording. Regularly this should be NULL; otherwise a higher user-permission is needed.
commitedWorkTimeOutThe committed work time
todayEntriesOutCollection of all entries of the current day.
Return valueThe current time entry that has been committed by the method.

CancelLogging

This method cancels the current work time recording. This can be necessary if the current work entry has not been ended correctly.

void CancelLogging(  
out TpFault fault,
TpAuthentication authentication);
Needed Permissionlogging@access
NameModifierDescription
FaultOutContains the error if an exception occurs.
AuthenticationUser authentication

LockSession

This method locks the current work time recording. This should be done e.g. when the screensaver is activated. This locking does not mean an instant break of the current work time recording. How the lock is handled will be defined with the locking settings.

void LockSession(  
out TpFault fault,
TpAuthentication authentication,
DateTime? lockTime);
Needed Permissionlogging@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
lockTimeTime that is used as the current lock time. If this parameter is null, the time at the server will be taken.

UnlockSession

This method unlocks the previously locked time entry. When unlocking the time entry, TimePunch analyses the lock time and decides how to handle the current work time recording.

ActiveTimeEntryDto UnlockSession(  
out TpFault fault,
TpAuthentication authentication,
DateTime? unlockTime);
Needed Permissionlogging@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
unlockTimeTime that is used as the current unlock time. If this parameter is null, the time at the server will be taken.
Return ValueThe unlocked time entry or NULL, if no time entry is active after unlocking the session.

SetAttendanceState

This method sets the attendance state for an employee.

void SetAttendanceState(  
out TpFault fault,
TpAuthentication authentication,
AttendanceState attendanceState,
DateTime? informationalChangeTime
);
Needed Permissionlogging@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
attendanceStateThe current attendance state that shell be set
informationalChangeTimeIf set, this is the time from which the new presence status should be valid. If not set, the current time is used.

SaveLoggingSettings

This method stores the recording settings for the TimePunch profile.

void SaveLoggingSettings(  
out TpFault fault,
TpAuthentication authentication,
LoggingSettingsDto settingsDto);
Needed Permissionlogging@settings
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
settingsDtoThe amended Logging Settings that shall be stored.

SearchLoggingSettings

This method returns the logging settings for the given search object.

List<LoggingSettingsDto> SearchLoggingSettings(  
out TpFault fault,
TpAuthentication authentication,
UserSearchDto userSearchDto);
Needed Permissionlogging@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
userSearchDtoSearch object containing the user search data. The coverage will be applied accordingly to the user authentication.
Return valueAll user logging settings.

GetLoggingContext

This method is the central place to load all data that are necessary in order to get an overview of the complete time recording status.

LoggingContextDto GetLoggingContext(  
out TpFault fault,
TpAuthentication authentication);
Needed Permissionlogging@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
Return valueAll data regarding the current time entry logging.

ValidateAndSaveActiveTimeEntry

This method is used to change the currently active time entry. It can be used to change the project, switch start and end time or to amend the project.

ActiveTimeEntryDto ValidateAndSaveActiveTimeEntry(  
out TpFault fault,
TpAuthentication authentication,
ActiveTimeEntryDto activeTimeEntry);
Needed Permissionlogging@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
activeTimeEntryThe active time entry that shall be stored
Return valueThe currently active time entry after the amendments

ValidateAndSaveRestrictedActiveTimeEntry

This method is used to amend the currently active time entry. Because the method needs less permission one can only change the description and the project or task.

ActiveTimeEntryDto ValidateAndSaveRestrictedActiveTimeEntry(  
out TpFault fault,
TpAuthentication authentication,
TimeEntryRestrictedSaveDto activeTimeEntry);
Needed Permissionlogging@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
activeTimeEntryThe active time entry that shall be stored
Return valueThe currently active time entry after the amendments